package homework.day10;

import java.util.Collection;
import java.util.HashSet;
import java.util.Random;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 *
 * @author Xiloer
 */
public class Test03 {
    public static void main(String[] args) {
        Collection<Integer> c = new HashSet<>();
        Random random = new Random();
        int b = 1;
        while (true) {
            int a = random.nextInt(100);
            c.add(a);
            if (c.size() == 10) {
                break;
            }
            b++;
        }
        System.out.println(c);
        System.out.println(b);
    }
}
